﻿// -----------------------------------------------------------------------
// <copyright file="CheckersMove.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace CheckersLogic
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class CheckersMove
    {
            private CheckerCell m_fromCell;
            private CheckerCell m_toCell;
            private char m_moveSymbol;
            private bool m_isEatingMove;

            public CheckersMove(CheckerCell i_fromCell, CheckerCell i_toCell, bool isEatingMove, char i_moveSymbol)
            {
                m_fromCell = i_fromCell;
                m_toCell = i_toCell;
                m_isEatingMove = isEatingMove;
                m_moveSymbol = i_moveSymbol;
            }

            public CheckersMove()
            {
                m_fromCell = new CheckerCell();
                m_toCell = new CheckerCell();
                m_moveSymbol = ' ';
                m_isEatingMove = false;
            }

            public CheckersMove(char moveSymbol, bool isEatingMove)
            {
                m_fromCell = new CheckerCell();
                m_toCell = new CheckerCell();
                m_moveSymbol = moveSymbol;
                m_isEatingMove = isEatingMove; 
            }

            public CheckerCell fromCell
            {
                get
                {
                    return m_fromCell;
                }

                set
                {
                    m_fromCell = value;
                }
            }

            public CheckerCell toCell
            {
                get
                {
                    return m_toCell;
                }

                set
                {
                    m_toCell = value;
                }
            }

            public bool isEatingMove
            {
                get
                {
                    return m_isEatingMove;
                }

                set
                {
                    m_isEatingMove = value;
                }
            }

            public char MoveSymbol
            {
                get
                {
                    return m_moveSymbol;
                }

                set
                {
                    m_moveSymbol = value;
                }
            }
            
            public static bool isEqual(CheckersMove i_firstMove, CheckersMove i_secondMove )
            {
                return i_firstMove.fromCell.equals(i_secondMove.fromCell) && i_firstMove.toCell.equals(i_secondMove.toCell);
            }
        }
    }
